<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center punchinTasks_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub punchinTasks_fd0_0'>
					<view class='flex flex-wrap align-center punchinTasks_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  punchinTasks_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='punchinTasks_fd0_0_c1_c0'
							style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;">我的签到</text>
					</view>
					<view class='flex flex-wrap align-center justify-end punchinTasks_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout punchinTasks_flex_1"
				style="font-family: Alimama DongFangDaKai;">
				<view class='flex flex-direction flex-wrap align-stretch punchinTasks_fd1_0'>
					<view class='flex flex-wrap align-center' style="align-items: baseline;">
						<text class='punchinTasks_fd1_0_c0_c0'
							style="line-height: 1;">{{signInfo.catch_sign_in_time}}</text>
						<text class='punchinTasks_fd1_0_c0_c1' style="margin-left: 24rpx;">天</text>
						<view class='flex flex-wrap align-center justify-center punchinTasks_fd1_0_c0_c2'
							@tap.stop="popupShow1698299746187=true">
							<image class='punchinTasks_fd1_0_c0_c2_c0' mode="aspectFit" :src='STATIC_URL+"548.png"'>
							</image>
							<text class='punchinTasks_fd1_0_c0_c2_c1'
								style="font-family: PingFang SC, PingFang SC;">签到规则</text>
						</view>
					</view>
					<view class='flex flex-wrap align-center punchinTasks_fd1_0_c1'>
						<text class='punchinTasks_fd1_0_c0_c1'>已累计签到</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<image class='punchinTasks_fd1_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"547.png"'></image>
						<text class='punchinTasks_fd1_0_c2_c1'>共获得</text>
						<text class='punchinTasks_fd1_0_c2_c2'>{{signInfo.score}}</text>
						<text class='punchinTasks_fd1_0_c2_c1'>积分</text>
					</view>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-wrap align-stretch benben-flex-layout punchinTasks_flex_2">
				<!-- <benben-calendar-diy mode='signin' year-arrow-color='#666666' month-arrow-color='#666666' start-text=' '
					end-text=' ' active-bg-color='rgba(150, 48, 29, 1)' range-bg-color='' :change-title='true'
					:change-year='true' :change-month='true' class=" punchinTasks_fd2_0"></benben-calendar-diy> -->
				<view class="punchinTasks_fd2_0">
					<ren-calendar ref='ren' :isClick="true" :markDays='markDays' :headerBar='true' :collapsible="false"
						@onDayClick='onDayClick' @onMonthClick="onMonthClick">
					</ren-calendar>
					<button class='punchinTasks_fd2_1' style="font-family: Alimama DongFangDaKai;"
						v-if="signInfo.is_today_sign_in == 0" @tap.stop="getSign">立即签到</button>
					<button class='punchinTasks_fd2_2' style="font-family: Alimama DongFangDaKai;" v-else
						@tap.stop="signSubmit">已签到</button>
				</view>

			</view>

			<!---flex布局flex布局结束-->
			<benben-popup v-model="popupShow1698299746187" :mask="true" :mask-close-able="true" mode='center'
				:z-index='999'>
				<!---flex布局flex布局开始-->
				<view class="flex benben-flex-layout flex-wrap align-center"
					style="font-family: Alimama DongFangDaKai;">
					<view class='flex flex-direction flex-wrap align-stretch punchinTasks_fd3_0'>
						<scroll-view :scroll-y="true">
							<u-parse :html="signInfo.sign_in_rule"></u-parse>
						</scroll-view>

						<view class='flex flex-wrap align-center punchinTasks_fd3_0_c1'
							@tap.stop="popupShow1698299746187=false">
						</view>
					</view>
				</view>

				<!---flex布局flex布局结束-->

			</benben-popup>
			<benben-popup v-model="popupShow1698300469846" :mask="true" :mask-close-able="true" mode='center'
				:z-index='999'>
				<!---flex布局flex布局开始-->
				<view class="flex benben-flex-layout flex-wrap align-center"
					style="font-family: Alimama DongFangDaKai;">
					<view class='flex flex-direction flex-wrap align-stretch punchinTasks_fd4_0'>
						<view class='flex flex-direction flex-wrap align-center'>
							<text class='punchinTasks_fd4_0_c0_c0'>签到成功</text>
							<text class='punchinTasks_fd4_0_c0_c1'>获得{{score}}积分</text>
							<view class='flex flex-wrap align-center justify-center punchinTasks_fd4_0_c0_c2'>
								<text class='punchinTasks_fd4_0_c0_c2_c0'
									@tap.stop="popupShow1698300469846=false">好的</text>
							</view>
						</view>
					</view>
				</view>

				<!---flex布局flex布局结束-->
			</benben-popup>
		</view>
	</view>
</template>
<script>
	import RenCalendar from '../components/ren-calendar/ren-calendar.vue'
	export default {
		components: {
			RenCalendar
		},


		data() {
			return {
				"popupShow1698300469846": false,
				"popupShow1698299746187": false,
				"curDate": '',
				"markDays": [],
				"date": "",
				"signInfo": {},
				"score": 0
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getSignData();
		},
		onUnload() {

		},
		onReady() {
			let today = this.$refs.ren.getToday().date;
			this.curDate = today;
			this.getCalendar();
		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			// 签到  6551e8b971c8f
			getSign() {
				this.$api.post(global.API_VERSION + '6551e8b971c8f', {

				}).then(res => {
					// console.log(res);
					if (res.data.code == 1) {
						this.score = res.data.data;
						this.popupShow1698300469846 = true;
						this.getSignData();
						this.getCalendar();
						this.resetGetUserInfo();
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			signSubmit() {
				this.$message.info('您今天已经签到过了');
				return;
			},

			// 签到页面数据  6551e8a572cb2
			getSignData() {
				this.$api.post(global.API_VERSION + '6551e8a572cb2', {

				}).then(res => {
					if (res.data.code == 1) {
						this.signInfo = res.data.data;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},

			// 日历数据  6551e55df372b
			getCalendar() {
				this.$api.post(global.API_VERSION + '6551e55df372b', {
					date: this.date
				}).then(res => {
					if (res.data.code == 1) {
						let arr = [];
						if (res.data.data.length > 0) {
							res.data.data.forEach((v, k) => {
								if (v.is_today_sign_in == 1) {
									arr.push(v.day);
								}
							})
						}
						this.markDays = arr;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			onMonthClick(e) {
				this.date = e;
				this.getCalendar();
			},
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://www.guochaoxiaoju.com/uploads/mini/546.png) no-repeat;
		background-size: 100% auto;
	}

	.punchinTasks_flex_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/546.png) no-repeat;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.punchinTasks_fd0_0_c1_c0 {
		font-size: 40rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 88rpx;
	}

	.punchinTasks_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: var(--benbenFontColor3);
	}

	.punchinTasks_fd0_0_c0 {
		width: 120rpx;
	}

	.punchinTasks_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.punchinTasks_flex_1 {
		padding: 30rpx 0rpx 0rpx 030rpx;
	}

	.punchinTasks_fd1_0_c2_c2 {
		color: rgba(167, 58, 40, 1);
		font-size: 38rpx;
		font-weight: 400;
	}

	.punchinTasks_fd1_0_c2_c1 {
		color: #333333;
		font-size: 38rpx;
		font-weight: 400;
	}

	.punchinTasks_fd1_0_c2_c0 {
		width: 42rpx;
		height: 40rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.punchinTasks_fd1_0_c1 {
		margin: 21rpx 0rpx 29rpx 0rpx;
	}

	.punchinTasks_fd1_0_c0_c2_c1 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 400;
		margin: 0rpx 0rpx 0rpx 8rpx;
	}

	.punchinTasks_fd1_0_c0_c2_c0 {
		width: 28rpx;
		height: 28rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.punchinTasks_fd1_0_c0_c2 {
		background: rgba(255, 255, 255, 0.7);
		border-radius: 100rpx 0rpx 0rpx 100rpx;
		width: 190rpx;
		height: 68rpx;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.punchinTasks_fd1_0_c0_c1 {
		color: #333333;
		font-size: 56rpx;
		font-weight: 400;
	}

	.punchinTasks_fd1_0_c0_c0 {
		color: #AD3823;
		font-size: 120rpx;
		font-weight: 400;
	}

	.punchinTasks_fd1_0 {
		margin: 0rpx 0rpx 28rpx 0rpx;
	}

	.punchinTasks_flex_2 {
		padding: 0rpx 30rpx 0rpx 30rpx;
		position: relative;
	}

	.punchinTasks_fd2_1 {
		background: linear-gradient(90deg, #BB4834 0%, #96301D 100%);
		border-radius: 44rpx;
		width: 540rpx;
		line-height: 88rpx;
		font-size: 36rpx;
		color: #fff;
		height: 88rpx;
		margin: 40rpx auto 40rpx;
	}

	.punchinTasks_fd2_2 {
		background: #eee;
		border-radius: 44rpx;
		width: 540rpx;
		line-height: 88rpx;
		font-size: 36rpx;
		color: #333;
		height: 88rpx;
		margin: 40rpx auto 40rpx;
	}

	.punchinTasks_fd2_0 {
		border: 2px solid #AD3823;
		background: #FFFFFF;
		width: 750rpx;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(0, 0, 0, 0.16), inset 0rpx 0rpx 16rpx 1rpx #AD3823;
		// height: 800rpx;
	}

	.punchinTasks_fd3_0_c1 {
		width: 50rpx;
		height: 50rpx;
		position: absolute;
		right: 0rpx;
		top: 7rpx;
	}

	.punchinTasks_fd3_0_c0_c0_c0 {
		color: #AD3823;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 44rpx;
	}

	.punchinTasks_fd3_0_c0_c0 {
		margin: 0rpx 0rpx 40rpx 0rpx;
	}

	.punchinTasks_fd3_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/701.png) no-repeat;
		width: 646rpx;
		height: 513rpx;
		background-size: 100% auto;
		padding: 70rpx 38rpx 90rpx 165rpx;
	}

	scroll-view {
		width: 100%;
		height: 420rpx;
	}

	.punchinTasks_fd4_0_c0_c2_c0 {
		color: #FFFFFF;
		font-size: 34rpx;
		font-weight: 400;
	}

	.punchinTasks_fd4_0_c0_c2 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/702.png) no-repeat;
		width: 383rpx;
		height: 71rpx;
		margin: 0rpx 0rpx 75rpx 0rpx;
		background-size: 100% auto;
	}

	.punchinTasks_fd4_0_c0_c1 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
		margin: 40rpx 0rpx 67rpx 0rpx;
		text-align: center;
	}

	.punchinTasks_fd4_0_c0_c0 {
		color: #333333;
		font-size: 40rpx;
		font-weight: 400;
		margin: 190rpx 0rpx 0rpx 0rpx;
	}

	.punchinTasks_fd4_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/692.png) no-repeat;
		width: 580rpx;
		background-size: 100% auto;
	}
</style>